package com.cupk.wudi.practice.apidemo.service.impl;


import com.cupk.wudi.practice.apidemo.entity.Animal;
import com.cupk.wudi.practice.apidemo.mapper.AnimalMapper;
import com.cupk.wudi.practice.apidemo.service.AnimalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AnimalServiceImpl implements AnimalService {

    @Autowired
    AnimalMapper animalMapper;

    @Override
    public List<Animal> getByType(String type) {
        return animalMapper.getAnimalByType(type);
    }

    public Animal getByName(String name){
        return animalMapper.getAnimalByName(name);
    }
    public Integer addAnimal(Animal animal){
        return animalMapper.addAnimal(animal);
    }

    @Override
    public Integer deleteAnimalByIDs(String IDs) {
        return animalMapper.deleteAnimalByIDs(IDs);
    }

    @Override
    public Integer updateAnimal(Animal animal){       //数据更新
        return animalMapper.updateAnimal(animal);
    }
}
